import { create } from 'zustand'

interface PriceStore {
    price: number,
    state: number,
    incrementPrice: () => void,
    decrementPrice: () => void,
    resetPrice: () => void,
    getState: () => number,
    getPrice: () => number,
}

export const usePriceStore = create<PriceStore>((set, get) => ({
    price: 0,
    state: 100,
    incrementPrice: () => set((state) => ({
        price: state.price + 1
    })),
    decrementPrice: () => set((state) => ({
        price: state.price - 1
    })),
    resetPrice: () => set({ price: 0 }),
    getState: () => get().state,
    getPrice: () => get().price,
}))